import fetch from "common/src/utils/fetch";

/**
 *  标记
 */
function examCourseMark(data, type) {
  return fetch({
    url: "/api/electionservice/examCourseGroup/examCourseMark?type=" + type,
    method: "post",
    data
  });
}

/**
 *  课程组合 查询课程
 */
function addCourseGroupQuery(data) {
  return fetch({
    url: "/api/electionservice/examCourseGroup/addCourseGroupQuery",
    method: "post",
    data
  });
}

/**
 *  添加课程组合
 */
function addCourseGroup(data, calendarId) {
  return fetch({
    url:
      "/api/electionservice/examCourseGroup/addCourseGroup?calendarId=" +
      calendarId,
    method: "post",
    data
  });
}

/**
 *  删除课程组合
 */
function deleteCourseGroup(data) {
  return fetch({
    url: "/api/electionservice/examCourseGroup/deleteCourseGroup",
    method: "post",
    data
  });
}

/**
 *  课程组合（重考）-修改
 */
function editReExamCourseGroup(data, calendarId, groupId) {
  return fetch({
    url: "/api/electionservice/examCourseGroup/editReExamCourseGroup?calendarId=" +
      calendarId +
      "&groupId=" +
      groupId,
    method: "post",
    data
  });
}

/**
 *  课程组合（重考）-新增
 */
function addReExamCourseGroup(data, calendarId) {
  return fetch({
    url: "/api/electionservice/examCourseGroup/addReExamCourseGroup?calendarId=" +
      calendarId,
    method: "post",
    data
  });
}

/**
 *  课程组合（重考）-新增时列表查询
 */
function addReExamCourseGroupQuery(data) {
  return fetch({
    url: "/api/electionservice/examCourseGroup/addReExamCourseGroupQuery",
    method: "post",
    data
  });
}

/**
 *  编辑课程组合
 */
function editCourseGroup(data, calendarId, groupId) {
  return fetch({
    url:
      "/api/electionservice/examCourseGroup/editCourseGroup?calendarId=" +
      calendarId +
      "&groupId=" +
      groupId,
    method: "post",
    data
  });
}

// /**
//  *  课程组合列表
//  */
// function listCourseGroup(data) {
//   return fetch({
//     url: "/api/electionservice/examCourseGroup/listCourseGroup",
//     method: "post",
//     data
//   });
// }

const pageUrl = "/api/electionservice/examCourseGroup/examCourseGroupQuery";
// const coursePageUrl =
//   "/api/electionservice/examCourseGroup/addCourseGroupQuery";
//课程组合列表查询。组合课程类型type 1：正常排考组合课程 2：缓考排开组合课程
const groupPageUrl = "/api/electionservice/examCourseGroup/listCourseGroup";

export default {
  examCourseMark: examCourseMark,
  addCourseGroup: addCourseGroup,
  addCourseGroupQuery: addCourseGroupQuery,
  deleteCourseGroup: deleteCourseGroup,
  editCourseGroup: editCourseGroup,
  groupPageUrl: groupPageUrl,
  pageUrl: pageUrl,
  editReExamCourseGroup:editReExamCourseGroup,
  addReExamCourseGroup:addReExamCourseGroup,
  addReExamCourseGroupQuery:addReExamCourseGroupQuery
  //coursePageUrl: coursePageUrl
};
